<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>The Grid: C:/GK/The Grid/TheGrid _doDokumentacji/graphic_engine/Player.h Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">The Grid
   
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
<div class="header">
  <div class="headertitle">
<div class="title">C:/GK/The Grid/TheGrid _doDokumentacji/graphic_engine/Player.h</div>  </div>
</div>
<div class="contents">
<a href="_player_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="preprocessor">#include &quot;<a class="code" href="stdafx_8h.html">stdafx.h</a>&quot;</span>
<a name="l00002"></a>00002 <span class="preprocessor">#include &quot;<a class="code" href="_grid_8h.html">Grid.h</a>&quot;</span>
<a name="l00003"></a>00003 <span class="preprocessor">#include &quot;<a class="code" href="_draw_helper_8h.html">DrawHelper.h</a>&quot;</span>
<a name="l00004"></a>00004 
<a name="l00005"></a><a class="code" href="class_player.html">00005</a> <span class="keyword">class </span><a class="code" href="class_player.html">Player</a>
<a name="l00006"></a>00006 {
<a name="l00007"></a>00007 <span class="keyword">public</span>:
<a name="l00008"></a><a class="code" href="class_player.html#a338a7d94ba2982d8b0ed2f86955cf1ef">00008</a>         <a class="code" href="class_player.html#a338a7d94ba2982d8b0ed2f86955cf1ef">Player</a>(<a class="code" href="class_grid.html">Grid</a> *<a class="code" href="class_player.html#aae38f1f6693d17a549874b85389c92cb">grid</a>)
<a name="l00009"></a>00009         {
<a name="l00010"></a>00010                 this-&gt;grid = <a class="code" href="class_player.html#aae38f1f6693d17a549874b85389c92cb">grid</a>;
<a name="l00011"></a>00011                 <a class="code" href="class_player.html#a0e8ebd3ed6500c869fef2d1c63063161">playerBatch</a> = 0 ;
<a name="l00012"></a>00012         }
<a name="l00013"></a><a class="code" href="class_player.html#aae38f1f6693d17a549874b85389c92cb">00013</a>         <a class="code" href="class_grid.html">Grid</a> *<a class="code" href="class_player.html#aae38f1f6693d17a549874b85389c92cb">grid</a>;
<a name="l00014"></a><a class="code" href="class_player.html#a0e8ebd3ed6500c869fef2d1c63063161">00014</a>         GLBatch *<a class="code" href="class_player.html#a0e8ebd3ed6500c869fef2d1c63063161">playerBatch</a>;
<a name="l00015"></a>00015         <span class="comment">//wektor obrotu</span>
<a name="l00016"></a><a class="code" href="class_player.html#a45f81daf9580eeaf01853eab4f5857c9">00016</a>         GLfloat <a class="code" href="class_player.html#a3d93fdaeecd0e1088d0327b0401f3438">playerZRotateX</a>, <a class="code" href="class_player.html#a45f81daf9580eeaf01853eab4f5857c9">playerZRotateY</a>;
<a name="l00017"></a>00017         <span class="comment">//predkosc obrotu</span>
<a name="l00018"></a><a class="code" href="class_player.html#a035cf346cc14e8964d213367c008355b">00018</a>         GLfloat <a class="code" href="class_player.html#a035cf346cc14e8964d213367c008355b">playerZRotateSpeed</a>;
<a name="l00019"></a>00019         <span class="comment">//predkosc ruchu</span>
<a name="l00020"></a><a class="code" href="class_player.html#a3f8a393d12c78e8be1654be8af056586">00020</a>         GLfloat <a class="code" href="class_player.html#a3f8a393d12c78e8be1654be8af056586">playerMoveSpeed</a>;
<a name="l00021"></a>00021         <span class="comment">//macierz transformacji modelu</span>
<a name="l00022"></a><a class="code" href="class_player.html#a2694cc70e18e5305cbb1274963ead245">00022</a>         M3DMatrix44f <a class="code" href="class_player.html#a2694cc70e18e5305cbb1274963ead245">playerMatrix</a>;
<a name="l00023"></a>00023         
<a name="l00024"></a><a class="code" href="class_player.html#a4874470366329a4ed47e6490da390b42">00024</a>         <span class="keywordtype">void</span> <a class="code" href="class_player.html#a4874470366329a4ed47e6490da390b42">showPlayer</a>(<span class="keywordtype">int</span> x, <span class="keywordtype">int</span> y, <span class="keywordtype">int</span> offsetX, <span class="keywordtype">int</span> offsetY, <span class="keywordtype">double</span> zRotateX, <span class="keywordtype">double</span> zRotateY)
<a name="l00025"></a>00025         {
<a name="l00026"></a>00026                 <a class="code" href="class_player.html#a0e8ebd3ed6500c869fef2d1c63063161">playerBatch</a> = <span class="keyword">new</span> GLBatch();
<a name="l00027"></a>00027 
<a name="l00028"></a>00028                 GLfloat* pos = <a class="code" href="class_player.html#aae38f1f6693d17a549874b85389c92cb">grid</a>-&gt;<a class="code" href="class_grid.html#ad265a29cf1376138b6f5e185b539e2ff">getPosition</a>(x, y, offsetX, offsetY);
<a name="l00029"></a>00029                 m3dTranslationMatrix44(<a class="code" href="class_player.html#a2694cc70e18e5305cbb1274963ead245">playerMatrix</a>, pos[0], pos[1], -0.2f);
<a name="l00030"></a>00030                 
<a name="l00031"></a>00031                 
<a name="l00032"></a>00032                 <a class="code" href="class_draw_helper.html#aa089868a5b30a6251cee4574712f28ac">DrawHelper::drawTriangle</a>(*<a class="code" href="class_player.html#a0e8ebd3ed6500c869fef2d1c63063161">playerBatch</a>, 0, 0, 0, 1, *this-&gt;<a class="code" href="class_player.html#aae38f1f6693d17a549874b85389c92cb">grid</a>);
<a name="l00033"></a>00033         }
<a name="l00034"></a><a class="code" href="class_player.html#a13fc194ae91a3d693cb8ea61bd321c22">00034</a>         <span class="keywordtype">void</span> <a class="code" href="class_player.html#a13fc194ae91a3d693cb8ea61bd321c22">movePlayer</a>(<span class="keywordtype">int</span> x, <span class="keywordtype">int</span> y, <span class="keywordtype">int</span> offsetX, <span class="keywordtype">int</span> offsetY)
<a name="l00035"></a>00035         {
<a name="l00036"></a>00036                 GLfloat* pos = <a class="code" href="class_player.html#aae38f1f6693d17a549874b85389c92cb">grid</a>-&gt;<a class="code" href="class_grid.html#ad265a29cf1376138b6f5e185b539e2ff">getPosition</a>(x, y, offsetX, offsetY);
<a name="l00037"></a>00037                 m3dTranslationMatrix44(<a class="code" href="class_player.html#a2694cc70e18e5305cbb1274963ead245">playerMatrix</a>, pos[0], pos[1], -0.2f);
<a name="l00038"></a>00038         }
<a name="l00039"></a><a class="code" href="class_player.html#ae7774bfa20e62fa694bdecf921ad32a9">00039</a>         <span class="keywordtype">void</span> <a class="code" href="class_player.html#ae7774bfa20e62fa694bdecf921ad32a9">rotatePlayer</a>(<span class="keywordtype">int</span> rotateAngle)
<a name="l00040"></a>00040         {
<a name="l00041"></a>00041 
<a name="l00042"></a>00042 
<a name="l00043"></a>00043         }
<a name="l00044"></a>00044 
<a name="l00045"></a>00045 };
</pre></div></div>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>



<hr class="footer"/><address class="footer"><small>
Generated on Fri Sep 30 2011 23:11:30 for The Grid by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.5.1
</small></address>

</body>
</html>
